<{include file="fenzhan:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
        <th><{$MOD.title}></th>
        <td align="right"><{link ctl="product/product:index" priv="hidden" class="button"}></td>
        <td width="15"></td>
      </tr>
    </table>
</div>
<div class="page-data">
<form action="?product/product-edit.html" mini-form="product-form" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="product_id" value="<{$detail.product_id}>" />
<input type="hidden" name="data[cat_id]" value="<{$pager.cat_id}>" />
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
    <li><a href="#table-info">基本信息</a></li>
    <li><a href="#table-attr">商品属性</a></li>
    <li><a href="#table-seo">SEO信息</a></li>
</ul>
<table width="100%" border="0" cellspacing="0" class="table-data form" id="table-info">
<tr><th>分类：</th>
    <td>
        <{foreach $parents as $v}><b class="blue"><{$v.title}></b><{if !$v@last}>&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;<{/if}><{/foreach}>
        <{link ctl="product/product:edit" arg0=$detail.product_id arg1='edit' load="mini:选择商品分类" confirm="mini:已经修改的内容将会丢失？" title="重选分类" class="button"}>
    </td>
</tr>
<tr><th>店铺：</th><td><b class="blue"><{$shop.title}></b></td></tr>
<tr><th><span class="red">*</span>标题：</th><td><input type="text" name="data[title]" value="<{$detail.title|default:''}>" class="input w-300"/></td></tr>
<tr><th><span class="red">*</span>名称：</th>
    <td><input type="text" name="data[name]" value="<{$detail.name|default:''}>" class="input w-300"/><span class="tip-comment">商品短名称、简称</span></td>
</tr>
<tr><th>城市：</th><td><b class="blue"><{$shop.city_name}></b>&nbsp;&nbsp; <select name="data[area_id]" class="w-100"><{widget id="data/area" city_id=$shop.city_id value=$detail.area_id}></td></tr>
<tr><th>店铺分类：</th><td><select name="data[vcat_id]" class="w-100"><{widget id="shop/vcate" shop_id=$shop.shop_id}></select></td></tr>
<tr><th>品牌：</th><td><select name="data[brand_id]" class="w-100"><option>--选择--</option><{widget id="shop/brand" cat_id=$pager.cat_id value=$detail.brand_id}></select></td></tr>
<tr>
    <th>封面：</th>
    <td>
        <input type="text" name="data[photo]" value="<{$detail.photo}>" <{if $detail.photo}>photo="<{$pager.img}>/<{$detail.photo}>_thumb.jpg"<{/if}> class="input w-300" />&nbsp;&nbsp;&nbsp;
        <input type="file" name="data[photo]" class="input w-100" />
    </td>
</tr>
<tr><th><span class="red">*</span>商品描述：</th><td><textarea name="fields[info]" kindeditor="full" style="width:800px;height:350px;"><{$detail.info}></textarea><br /></td></tr>
<tr><th>价格：</th>
    <td>
        <label>市场价:<input type="text" name="data[market_price]" value="<{$detail.market_price|default:'0.00'}>" class="input w-100"/></label>
        <label>商铺价:<input type="text" name="data[price]" value="<{$detail.price|default:'0.00'}>" class="input w-100"/></label>
    </td>
</tr>
<tr><th>单位：</th>
    <td><input type="text" name="data[danwei]" value="<{$detail.danwei|default:'个'}>" class="input w-200"/><span class="tip-comment">如:个、件、每平方、每米等</span></td>
</tr>
<tr>
    <th>类型：</th>
    <td>
        <ul class="group-list">
            <li><label><input type="radio" name="data[sale_type]" value="0" <{if empty($detail.sale_type)}>checked="checked"<{/if}>>普通</label></li>
            <li><label><input type="radio" name="data[sale_type]" value="1" <{if $detail.sale_type==1}>checked="checked"<{/if}>>限量</label></li>
            <li><label><input type="radio" name="data[sale_type]" value="2" <{if $detail.sale_type==2}>checked="checked"<{/if}>>限时</label></li>
            <div class="clear-both"></div>
        </ul>
    </td>
</tr>
<tr id="tr_sale_time" class="hide"><th class="red">限时：</th><td><input type="text" name="data[sale_time]" value="<{if $detail.sale_time}><{$detail.sale_time|format:'Y-m-d H:i:s'}><{/if}>" datetime="sale_time" class="input w-150"/><span class="tip-comment">只有在类型为"限时"时有效</span></td></tr>
<tbody id="tr_sale_sku" class="hide">
<tr><th class="red">库存数：</th><td><input type="text" name="data[sale_sku]" value="<{$detail.sale_sku|default:''}>" class="input w-100"/><span class="tip-comment">只有在类型为"限量"时有效</span></td></tr>
<tr><th class="red">已售数：</th><td><input type="text" name="data[sale_count]" value="<{$detail.sale_count|default:''}>" class="input w-100"/><span class="tip-comment">只有在类型为"限量"时有效</span></td></tr>
</tbody>
<tr>
    <th>促销：</th>
    <td>
        <ul class="group-list">
            <li><label><input type="checkbox" name="data[sale_remai]" value="1" <{if $detail.sale_remai}>checked="checked"<{/if}>>热卖</label></li>
            <li><label><input type="checkbox" name="data[sale_youhui]" value="1" <{if $detail.sale_youhui}>checked="checked"<{/if}>>优惠</label></li>
            <li><label><input type="checkbox" name="data[sale_tuijian]" value="1" <{if $detail.sale_tuijian}>checked="checked"<{/if}>>推荐</label></li>
            <div class="clear-both"></div>
        </ul>
    </td>
</tr>
<tr><th>排序：</th><td><input type="text" name="data[orderby]" value="<{$detail.orderby|default:'50'}>" class="input w-50"/></td></tr>
<tr>
    <th>在线支付：</th>
	<td>
        <ul class="group-list">
		    <li><label><input type="radio" name="data[onpayment]" <{if $detail.onpayment}>checked="checked"<{/if}> value="1"/>是</label></li>
		    <li><label><input type="radio" name="data[onpayment]" <{if empty($detail.onpayment)}>checked="checked"<{/if}> value="0"/>否</label></li>
        </ul>
	</td>
</tr>
<tr>
    <th>上架：</th>
	<td>
        <ul class="group-list">
		    <li><label><input type="radio" name="data[onsale]" <{if $detail.onsale}>checked="checked"<{/if}> value="1"/>上架</label></li>
		    <li><label><input type="radio" name="data[onsale]" <{if empty($detail.onsale)}>checked="checked"<{/if}> value="0"/>下架</label></li>
        </ul>
	</td>
</tr>
<tr>
	<th>审核：</th>
	<td>
        <ul class="group-list">
		    <li><label><input type="radio" name="data[audit]" <{if $detail.audit}>checked="checked"<{/if}> value="1"/>发布</label></li>
		    <li><label><input type="radio" name="data[audit]" <{if empty($detail.audit)}>checked="checked"<{/if}> value="0"/>待审</label></li>
        </ul>
	</td>
</tr>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" class="table-data form" id="table-attr" style="display:none;">
<{widget id="shop/attr" cat_id=$pager.cat_id value=$detail.attrvalues}>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" class="table-data form hide" id="table-seo">
    <tr><th>SEO标题：</th><td><input type="text" name="fields[seo_title]" value="<{$detail.seo_title|default:''}>" class="input w-500"/></td></tr>
    <tr><th>SEO关键字：</th><td><input type="text" name="fields[seo_keywords]" value="<{$detail.seo_keywords|default:''}>" class="input w-500"/></td></tr>
    <tr><th>SEO描述：</th><td><textarea name="fields[seo_description]" class="textarea"><{$detail.seo_description}></textarea><br /></td></tr>
    <tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
</form></div>
<script src="<{$pager.res}>/swfupload/swfupload.js" type="text/javascript"></script>
<script src="<{$pager.res}>/script/kt.upload.js" type="text/javascript"></script>
<script type="text/javascript" src="<{$pager.res}>/kindeditor/kindeditor.js"></script>
<script type="text/javascript">
(function(K, $){
$("div.page-data").tabs();
var editor = KindEditor.create('textarea[kindeditor]', {uploadJson : '?magic/upload-editor.html', extraFileUploadParams:{OFZTOKEN:"<{$OFZTOKEN}>"}});
$("[name='data[sale_type]']").click(function(){
    if($(this).val() == 2){
        $("#tr_sale_sku").hide();
        $("#tr_sale_time").show();
    }else if($(this).val() == 1){
        $("#tr_sale_time").hide();
        $("#tr_sale_sku").show();    
    }else{
        $("#tr_sale_sku").hide();
        $("#tr_sale_time").hide();    
    }
});
$("[name='data[sale_type]']:checked").trigger("click");
})(window.KT, window.jQuery);
</script>
<{include file="fenzhan:common/footer.html"}>